<%--
  Created by IntelliJ IDEA.
  User: 35317
  Date: 2024/12/18
  Time: 10:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../css/styles.css">
  <title>注册界面</title>
</head>
<body>
<div class="registration-container">
  <h1>创建账户</h1>
  <form id="registrationForm" onsubmit="return handleRegister()" method="post" action="/gym/register">
    <div class="input-group">
      <label for="username">用户名</label>
      <input type="text" id="username" name="username" placeholder="输入用户名称" required>
    </div>
    <div class="input-group">
      <label for="password">密码</label>
      <input type="password" id="password" name="password" placeholder="输入密码" required>
    </div>
    <div class="input-group">
      <label for="confirm-password">确认密码</label>
      <input type="password" id="confirm-password" placeholder="确认密码" required>
    </div>
    <div class="mb-3">
      <label for="captcha" class="form-label">验证码：</label>
      <div class="d-flex align-items-center">
        <input type="text" id="captcha" name="captcha" class="form-control" required>
        <img id="verificationCodeImg" src="<%= request.getAttribute("captchaImageUrl") != null ? request.getAttribute("captchaImageUrl") : "http://localhost:8080/gym/kaptcha.jpg" %>"
             class="captcha-img ms-2" alt="验证码" />
      </div>
    </div>
    <button type="submit">注册</button>
  </form>
  <div id="message"></div>
  <div class="footer">
    <p>已经有账户？<a href="login.jsp">登录</a></p>
  </div>
</div>
<script src="../js/script.js"></script>
</body>
</html>

